//地图容器
//var chart = echarts.init(document.getElementById('mainmap'));
//var dom = document.getElementById("data1");
//var myChart = echarts.init(dom);
//var app = {};
//app.title = '坐标轴刻度与标签对齐';

var dom2 = document.getElementById("data2");
var myChart2 = echarts.init(dom2);
var app2 = {};
//
//var dom3 = document.getElementById("data3");
//var myChart3 = echarts.init(dom3);
//var app3 = {};

var dom4 = document.getElementById("data4");
var myChart4 = echarts.init(dom4);
var app4 = {};

option = {
    title: {
        text: '2018年度盈利数量增长',
        subtext: '',
        x: 'center',
        color: "#fff",
        textStyle: {
            color: "#fff",
            fontSize: 24
        }
    },
    color: ['#ff9b00'],
    tooltip: {
        trigger: 'axis',
        axisPointer: {            // 坐标轴指示器，坐标轴触发有效
            type: 'line'        // 默认为直线，可选为：'line' | 'shadow'
        },
        color: "#fff",
        textStyle: {
            color: "#fff"
        }
    },
    grid: {
        left: '3%',
        right: '4%',
        bottom: '3%',
        containLabel: true,
        textStyle: {
            color: "#fff"
        },
        color: "#fff"
    },
    xAxis: [
        {
            type: 'category',
            data: ['2018年9月', '2018年10月', '2018年11月', '2018年12月'],
            axisTick: {
                alignWithLabel: true
            },
            axisLabel: {
                interval: 0,//横轴信息全部显示
                rotate: 0,//-30度角倾斜显示
            },
            axisLine: {
                lineStyle: {
                    color: '#fff',
                    width: 1,//这里是为了突出显示加上的
                }
            }
        }
    ],
    yAxis: [
        {
            type: 'value',
            axisLine: {
                lineStyle: {
                    color: '#fff',
                    width: 1,//这里是为了突出显示加上的
                }
            }
        }
    ],
    series: [
        {
            name: '增长数量',
            type: 'bar',
            barWidth: '60%',
            data: [0,0,0,0]
        }
    ]
};


function showTime() {
    var nowtime = new Date();
    var year = nowtime.getFullYear();
    var month = nowtime.getMonth() + 1;
    var date = nowtime.getDate();
    var hh = nowtime.getHours();
    var mm = nowtime.getMinutes();
    var ss = nowtime.getSeconds();

    if (hh < 10) {
        hh = "0" + hh;
    }
    if (ss < 10) {
        ss = "0" + ss;
    }
    if (mm < 10) {
        mm = "0" + mm;
    }
    if (document.getElementById("date")){
        document.getElementById("date").innerText = year + "年" + month + "月" + date + "日  ";
        document.getElementById("date2").innerText = hh + ":" + mm + ":" + ss + "  ";
    }else {
        clearInterval(iCount);
    }

}
var iCount = setInterval("showTime()", 1000);


option2 = {
    title: {
        text: '员工盈利数据统计',
        subtext: '',
        x: 'center',
        color: "#fff",
        textStyle: {
            color: "#fff",
            fontSize: 24
        }
    },
    tooltip: {
        trigger: 'item',
        formatter: "{a} <br/>{b} : {c} ({d}%)"
    },
    legend: {
        show: false,
        orient: 'vertical',
        left: 'left',
        data: ['高中及以下', '专科', '本科', '研究生', '博士及以上']
    },
    lineStyle: {
        color: "#FFF"
    },
    series: [
        {
            name: '创业青年学历',
            type: 'pie',
            label: {
                normal: {
                    formatter: '{b}:{c} ({d}%)',
                    textStyle: {
                        fontWeight: 'bold',
                        fontSize: 15
                    }
                }
            },
            radius: '55%',
            center: ['50%', '60%'],
            data: [
                {value: 0, name: '200以下'},
                {value: 0, name: '500以下'},
                {value: 0, name: '1000以下'},
                {value: 0, name: '2000以下'},
                {value: 0, name: '5000以下'}
            ],
            itemStyle: {
                emphasis: {
                    shadowBlur: 10,
                    shadowOffsetX: 0,
                    shadowColor: 'rgba(0, 0, 0, 0.9)'
                }
            },
            color: ['#c23531', '#c4ccd3', '#d48265', '#19c30f', '#ca8622', '#6e7074', '#546570', '#c4ccd3']
        }
    ]
};

option3 = {
    title: {
        text: '创业青年年龄统计',
        subtext: '',
        x: 'center',
        color: "#fff",
        textStyle: {
            color: "#fff",
            fontSize: 24
        }
    },
    tooltip: {
        trigger: 'item',
        formatter: "{a} <br/>{b} : {c} ({d}%)"
    },

    lineStyle: {
        color: "#FFF"
    },
    series: [
        {
            name: '创业青年年龄分布',
            type: 'pie',
            label: {
                normal: {
                    formatter: '{b}:{c} ({d}%)',
                    textStyle: {
                        fontWeight: 'bold',
                        fontSize: 15
                    }
                }
            },
            radius: '55%',
            center: ['50%', '60%'],
            data: [
                {value: 17, name: '20岁以下'},
                {value: 125, name: '21岁~25岁'},
                {value: 358, name: '26岁~30岁'},
                {value: 147, name: '30岁~35岁'},
                {value: 125, name: '35岁~40岁'},
                {value: 43, name: '40岁以上'}
            ],
            itemStyle: {
                emphasis: {
                    shadowBlur: 10,
                    shadowOffsetX: 0,
                    shadowColor: 'rgba(0, 0, 0, 0.9)'
                }
            },
            color: ['#d48265', '#19c30f', '#ca8622', '#6e7074', '#c4ccd3', '#c23531', '#c4ccd3']
        }
    ]
};

var option4 = {
    title: {
        text: '2018年度盈利增长趋势',
        subtext: '',
        x: 'center',
        color: "#fff",
        textStyle: {
            color: "#fff",
            fontSize: 24
        }
    },
    xAxis: {
        type: 'category',
        data: [
            '2017年10月',
            '2017年11月',
            '2017年12月',
        ],
        axisTick: {
            alignWithLabel: true
        },
        axisLabel: {
            interval: 0,//横轴信息全部显示
            rotate: 0,//-30度角倾斜显示
        },
        axisLine: {
            lineStyle: {
                color: '#fff',
                width: 1,//这里是为了突出显示加上的
            }
        }
    },

    yAxis: {
        type: 'value',
        axisLine: {
            lineStyle: {
                color: '#fff',
                width: 1,//这里是为了突出显示加上的
            }
        }
    },
    series: [
        {
            name: '创业青年年龄分布',
            label: {
                normal: {
                    formatter: '{b}:{c} ({d}%)',
                    textStyle: {
                        fontWeight: 'bold',
                        fontSize: 15
                    }
                }
            },
            data: [0, 0, 0, 0],
            type: 'line',

            color: ['#19c30f', '#ca8622', '#6e7074', '#546570', '#c4ccd3']
        }]
};


//myChart.setOption(option, true);
myChart2.setOption(option2, true);
//myChart3.setOption(option3, true);
myChart4.setOption(option4, true);
